package com.record.service.impl;


import com.record.dto.FormulaIngredientDto;
import com.record.entity.Formula;
import com.record.mapper.FormulaMapper;
import com.record.service.FormulaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FormulaServiceImpl implements FormulaService {

    @Autowired
    private FormulaMapper formulaMapper;

    @Override
    public Formula getFormulaByName(String formulaName) {
        return formulaMapper.selectFormulaWithIngredients(formulaName);
    }

    @Override
    public List<FormulaIngredientDto> getByIngredient(String ingredientName) {
        return formulaMapper.selectByIngredient(ingredientName);
    }


}


